package com.polymer.app.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.polymer.app.entity.InstitutionDO;
@Mapper
public interface InstitutionMapper {
    int insert(InstitutionDO record);

    int insertSelective(InstitutionDO record);

    int updateByPrimaryKeySelective(InstitutionDO record);

    int updateByPrimaryKey(InstitutionDO record);

    Long countByInscodeAndCityCode(@Param("cityCode") String cityCode, @Param("insCode") String insCode);

    Long countByCityCodeAndinsCodeAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("organType") String organType);

    InstitutionDO selectIsHaveLatitudeAndLongitudeByH(@Param("cityCode") String cityCode, @Param("insCode") String insCode);

    List<InstitutionDO> selectByHCityCodeAndinsCodeAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("latitude") double latitude,
            @Param("longitude") double longitude, @Param("val") int val, @Param("startRow") long startRow, @Param("endRow") long endRow);

    List<InstitutionDO> selectHaveLatitudeAndLongitudeByHCityCodeAndinsCodeAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("latitude") double latitude,
            @Param("longitude") double longitude, @Param("val") int val, @Param("startRow") long startRow, @Param("endRow") long endRow);

    List<InstitutionDO> selectByPCityCodeAndinsCodeAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("organType") String organType,
            @Param("startRow") long startRow, @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude,
            @Param("val") int val);

    List<InstitutionDO> selectAreaByCityCodeAndinsCodeAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode);

    List<InstitutionDO> selectCategoryByCityCodeAndinsCodeAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode);

    List<InstitutionDO> selectShopByCatagory(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("category") String category, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    List<InstitutionDO> selectShopByArea(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("area") String area, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    List<InstitutionDO> selectPByWordAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    List<InstitutionDO> selectPByWordAndTypePY(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    List<InstitutionDO> selectHByWordAndType(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    List<InstitutionDO> selectHByWordAndTypePY(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    Long countByTypeA(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("type") String type);

    Long countByTypeC(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("type") String type);

    int selectShopByCatagoryCount(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("category") String category, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    int selectShopByAreaCount(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("area") String area, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    int selectPByWordAndTypeCount(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    int selectPByWordAndTypeCountPY(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow, @Param("longitude") double longitude, @Param("latitude") double latitude, @Param("val") int val);

    int selectHByWordAndTypeCount(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow);

    int selectHByWordAndTypeCountPY(@Param("cityCode") String cityCode, @Param("insCode") String insCode, @Param("word") String word, @Param("startRow") long startRow,
            @Param("endRow") long endRow);
}